package com.gxa.hualianeshop.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.gxa.hualianeshop.common.base.R;
import com.gxa.hualianeshop.entity.pojo.Banner;
import com.gxa.hualianeshop.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author bill
 * @date 2023/7/19 16:27
 */
@RestController
@RequestMapping("/banner")
public class BannerController {

    @Reference
    private BannerService bannerService;

    @GetMapping("/getAll")
    public R getAll(String position){
        List<Banner> allByPosition = bannerService.getAllByPosition(position);
        return R.ok(allByPosition);
    }
}
